#!/usr/bin/python
# -*- coding: utf-8 -*-

'''
Introduction to Programming in Java - An Interdisciplinary Approach

All book programs ported to Python by
Scott C. King (revisionx at {gee}ma1l <dot> c0m).

All program examples pass Pylint with a perfect 10.00 score.
Pylint:  http://www.pylint.org/


Program 1.5.4 - A simple filter

Syntax:
python rangefilter.py 100 400
(Press CTRL-D when done, or pipe in input as in the book examples)


Notes:
Notes:
int(sys.argv[1]) == Integer.parseInt(args[0])

sys is a required import here in order to use stdin/sys.argv.
https://docs.python.org/2/tutorial/stdlib.html

'''

import sys


def main():
    ''' Average a stream of numbers from user input using stdin '''

    low = int(sys.argv[1])
    high = int(sys.argv[2])

    for value in sys.stdin:
        value = int(value.strip())
        if value >= low and value <= high:
            print value


if __name__ == '__main__':
    main()
